#include "pixelwifi.h"
#include "disp.h"
#include "task.h"
#include "bitmap.h"
#include "WiFiManager.h"
#include "EEPROM.h"
#include "ui.h"
#include "touch.h"

uint8_t WIFI_STATE  = 0;
uint8_t smart_config = 0;
extern uint8_t force_request;
extern uint8_t font_color[3];
char wifi_ssid[20];
char wifi_pwd[20];
char weather_key[20];
char weather_city[20];
char blinker_key[20];
WebServer httpServer(80);
HTTPUpdateServer httpUpdater;
WiFiManager wm;
WiFiManagerParameter set_weather_key("weather_key", "WeatherKey", NULL, 20);
WiFiManagerParameter set_blinker_key("blinker_key", "BlinkerKey", NULL, 20);
WiFiManagerParameter set_city("city", "City", NULL, 20);

void wifiCheckTask(void)
{
    if(WiFi.status() == WL_CONNECTED)
    {
        WIFI_STATE = 1;
        Serial.println("wifi connected");
    }
    else
    {
        WIFI_STATE = 0;
        Serial.println("wifi disconnected");
    }
}

void initWiFi(void)
{
    WiFi.begin("Icesu_room", "2ap99018");
    WiFi.setAutoReconnect(true);
}
